#![no_std]
#![no_main]

mod lang_items;
mod sbi;

#[macro_use]
mod console;

use core::arch::global_asm;
global_asm!(include_str!("entry.asm"));

#[no_mangle]
pub fn rust_main() -> ! {
   println!("Hello, world!");

   // 引入全局符号
   extern "C" {
      fn stext();
      fn etext();
      fn srodata();
      fn erodata();  
      fn sdata();
      fn edata();
   }

   info!(".text [{:#x}, {:#x})", stext as usize, etext as usize);
   warn!(".rodata [{:#x}, {:#x})", srodata as usize, erodata as usize);
   error!(".data [{:#x}, {:#x})", sdata as usize, edata as usize);

   panic!("Shutdown machine!");

}
